Moving picture decoding device, moving picture decoding method, and moving picture decoding program

ABSTRACT

A motion vector decoding unit derives a motion vector of a prediction block subject to decoding on the basis of a motion vector of a candidate block included in candidate blocks selected from neighboring blocks. The motion compensation prediction unit performs motion compensation prediction using the derived motion vector. In case a motion vector number of a first block and a motion vector number of a second block are identical with each other, the motion vector decoding unit determines whether or not to set the second block as a candidate block in accordance with whether or not a reference index indicating a reference picture that the motion vector of the first block refers to and a reference index indicating a reference picture that the motion vector of the second block refers to are identical with each other.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. Ser. No. 17/880,884, filedAug. 4, 2022; which is a continuation of U.S. Ser. No. 17/140,549, filedJan. 4, 2021, now U.S. Pat. No. 11,445,212; which is a continuation ofU.S. Ser. No. 16/558,604, filed Sep. 3, 2019, now U.S. Pat. No.10,911,774; which is a continuation of U.S. Ser. No. 14/063,924, filedOct. 25, 2013, now U.S. Pat. No. 10,425,657; which is a continuation ofInternational Application No. PCT/JP2012/002840, filed Apr. 25, 2012;which claims the benefit of Japanese Application Nos. 2012-098925, filedApr. 24, 2012; 2012-098924, filed Apr. 24, 2012; 2011-100031, filed Apr.27, 2011; and 2011-100030, filed Apr. 27, 2011, the entire disclosuresof which are incorporated herein by reference.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention generally relates to picture decoding technologyutilizing motion compensation prediction, and more particularly, to atechnology for deriving a motion vector to be used in the motioncompensation prediction.

2. Description of the Related Art

In picture compression-encoding, motion compensation prediction istypically used in order to increase compression efficiency by usingcorrelation between pictures over time. According to motion compensationprediction, a predicted value is derived from a reference picture bytaking the direction and quantity of motion indicated by a motion vectorinto account. By encoding a difference value between the predicted valuederived from the motion compensation prediction and a pixel value of apicture subject to encoding, redundancy is removed and compressionefficiency can be increased.

By MPEG-4AVC or the like, which is the latest picturecompression-encoding technology, one picture is encoded as an I picture,a P picture, or a B picture. An I picture is encoded by information onthe picture itself. To a P picture, a unidirectional motion compensationprediction can be applied. To a B picture, a bidirectional motioncompensation prediction can be applied.

In case of encoding a motion vector of a certain block subject toencoding, a motion vector predictor is derived from one or moreneighboring blocks, firstly. Then a motion vector difference between themotion vector of the certain block subject to encoding and the motionvector predictor is calculated, and the motion vector difference isentropy encoded. The reason for deriving a motion vector predictor fromone or more neighboring blocks is that the motion vector of the blocksubject to encoding is considered to have a correlation with the motionvector of the neighboring block(s). The entropy encoding techniqueutilizes this correlation to compress pictures so that the smaller theabsolute value of a motion vector difference is, the higher thecompression efficiency of the motion vector is.

A method for predicting a motion vector by using one or more blocksneighboring a block subject to encoding is disclosed in the patentdocument 1.

RELATED ART LIST Patent Document

[Patent Document 1] Japanese Patent Application Publication No.2004-96705

According to the conventional motion vector coding method describedabove, a motion vector predictor is derived for each predictiondirection (i.e., direction to the previous picture, direction to thesubsequent picture, or the like). Therefore, in case that a motion of anobject having a time correlation different from that of a motion of ablock subject to encoding exists in a neighboring block, sometimes amotion vector predictor that is irrelevant to the original motion of anobject in the block subject to encoding is derived and the compressionefficiency of the motion vector is not improved.

SUMMARY OF THE INVENTION

The present invention addresses the aforementioned issue, and a purposethereof is to provide a motion vector encoding technology and a motionvector decoding technology that can improve the compression efficiencyof a motion vector at encoding and improve the accuracy of motion vectorderivation at decoding.

In order to address the aforementioned issues, a moving picture decodingdevice adapted to decode a bitstream encoded by using motioncompensation prediction in units of blocks obtained by partitioning eachpicture of moving pictures is provided in accordance with an aspect ofthe invention. The device includes: a motion information derivation unit(550) configured to derive a motion vector of a prediction block subjectto decoding on the basis of a motion vector of a candidate blockincluded in candidate blocks selected from neighboring blocks of theprediction block subject to decoding; and a motion compensationprediction unit (530) configured to generate a prediction signal of theprediction block subject to decoding by motion compensation predictionusing the motion vector derived by the motion information derivationunit. The motion information derivation unit (550) determines, in case amotion vector number of a first block and a motion vector number of asecond block are identical with each other, whether or not to set thesecond block as a candidate block in accordance with whether or not areference index indicating a reference picture that a motion vector ofthe first block refers to and a reference index indicating a referencepicture that a motion vector of the second block refers to are identicalwith each other.

According to another aspect of the invention, a moving picture decodingmethod adapted to decode a bitstream encoded by using motioncompensation prediction in units of blocks obtained by partitioning eachpicture of moving pictures is provided. The method includes: deriving amotion vector of a prediction block subject to decoding on the basis ofa motion vector of a candidate block included in candidate blocksselected from neighboring blocks of the prediction block subject todecoding; and generating a prediction signal of the prediction blocksubject to decoding by motion compensation prediction using the derivedmotion vector. In case a motion vector number of a first block and amotion vector number of a second block are identical with each other,the deriving determines whether or not to set the second block as acandidate block in accordance with whether or not a reference indexindicating a reference picture that a motion vector of the first blockrefers to and a reference index indicating a reference picture that amotion vector of the second block refers to are identical with eachother.

Optional combinations of the aforementioned constituting elements, andimplementations of the invention in the form of methods, apparatuses,systems, recording mediums, computer programs, or the like may also bepracticed as additional modes of the present invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B illustrate a relation between a block subject toencoding and neighboring blocks;

FIG. 2 shows a flowchart for illustrating a conventional method forpredicting a motion vector;

FIG. 3 shows a specific example of the conventional method forpredicting a motion vector;

FIG. 4 shows a configuration of a moving picture encoding deviceaccording to a first embodiment;

FIG. 5 shows a detailed configuration of a motion vector numberderivation unit and a motion vector encoding unit in FIG. 4 ;

FIG. 6 shows a flowchart for illustrating a method for deriving a motionvector predictor according to the first embodiment in detail;

FIG. 7 shows a configuration of a moving picture decoding deviceaccording to a first embodiment;

FIG. 8 shows a detailed configuration of a motion vector numberderivation unit and a motion vector decoding unit in FIG. 7 ;

FIG. 9 shows a configuration of a moving picture encoding deviceaccording to a second embodiment;

FIG. 10 shows a flowchart for illustrating a method for deriving amotion vector predictor according to the second embodiment in detail;

FIGS. 11A-11E illustrate a relation between a macroblock border and aprediction block;

FIG. 12 shows a configuration of a moving picture decoding deviceaccording to the second embodiment;

FIG. 13 shows another specific example of the conventional method forpredicting a motion vector; and

FIG. 14 shows a flowchart for illustrating a method for deriving amotion vector predictor according to a third embodiment in detail.

DETAILED DESCRIPTION OF THE INVENTION

The invention will now be described by reference to the preferredembodiments. This does not intend to limit the scope of the presentinvention, but to exemplify the invention.

First, an explanation will be given on technologies, which theembodiments of the invention presuppose.

Devices and systems that comply with a coding method such as MovingPicture Experts Group (MPEG) or the like have become popular nowadays.According to such coding methods, a plurality of pictures consecutivealong the time axis is processed as information in the form of digitalsignals. In this process, the information is compressed and encoded byusing motion compensation prediction that utilizes redundancy in timeand by using orthogonal transformation (e.g., discrete cosinetransformation or the like) that utilizes redundancy in space in orderto broadcast, to transmit, or to store the information with highefficiency.

In 1995, the MPEG-2 video (ISO/IEC 13818-2) coding method wasestablished as a general purpose picture compression-coding method. TheMPEG-2 video coding method has been widely used for a storage medium(e.g., a Digital Versatile Disk (DVD), magnetic tape for digital VTRcomplying with D-VHS (a registered trademark) standard), and for anapplication for digital broadcasting or the like.

Further in 2003, a coding method referred to as MPEG-4 AVC/H.264 (astandard number 14496-10 is accredited by ISO/IEC and a standard numberH.264 is accredited by ITU-T. Herein after this coding method isreferred to as “MPEG-4AVC”) is adopted as an international standard bycooperative activity of the Joint Technical Committee (ISO/IEC) of theInternational Organization for Standardization (ISO) and theInternational Electrotechnical Commission (IEC), and the InternationalTelecommunication Union telecommunication Standardization Sector(ITU-T).

In these coding methods, motion compensation prediction is used.According to the motion compensation prediction, a predicted value isderived from a reference picture by taking the direction and quantity ofmotion indicated by a motion vector into account. By encoding adifference value between the predicted value derived by the motioncompensation prediction and a pixel value of a picture subject toencoding, redundancy is removed and compression efficiency can beimproved.

Pictures are classified into three types in accordance with a method ofusing motion compensation prediction. The three types of pictures are:an I picture that does not use motion compensation prediction; a Ppicture to which unidirectional motion compensation prediction can beapplied; and a B picture to which bidirectional motion compensationprediction can be applied.

For a P picture of MPEG-2, motion compensation prediction is performedin units of macroblocks by using a I picture or a P picture that isright before the P picture in the display order as a reference picture.In contrast, according to MPEG-4AVC, a plurality of encoded pictures canbe used as reference pictures, and a most appropriate picture can bechosen from the plurality of encoded pictures for each prediction block(an explanation will be given later) so as to perform motioncompensation prediction. In addition to a picture that precedes in thedisplay order, a picture that follows in the display order can also bereferred to.

For a B picture of MPEG-2, one of three types of motion compensationprediction can be performed: motion compensation prediction using onereference picture previous in the display order; motion compensationprediction using one reference picture subsequent in the display order;or motion compensation prediction performed by averaging the tworeference pictures. In contrast, according to MPEG-4AVC, a referencepicture is not limited to one previous picture and/or one subsequentpicture in the display order, but an arbitrary reference picture can beused for motion compensation prediction regardless of the previouspicture or subsequent picture. Further, a B picture can also be referredto as a reference picture.

In this manner, according to MPEG-4AVC, an arbitrary encoded picture canbe referred to. Therefore, a decoded picture is stored in a referenceframe memory so as to be managed.

According to MPEG-4AVC, a reference picture list is constructed byarranging pictures stored in the reference frame memory in apredetermined manner, and a reference picture is designated bydescribing the index thereof in the bitstream thereof. The “referencepicture list” is a list where reference pictures in a reference framethat is used for motion compensation prediction can be rearranged. Byrearranging reference pictures in accordance with a frequency of usageby using the reference picture list, encoding efficiency can beimproved.

Further, for the reference picture list, the list described above can berearranged by sending information on the change of reference picturelist in a slice header attached for each slice.

According to motion compensation prediction with MPEG-4AVC, an encodedpicture registered in the reference picture list is set as a referencepicture in units of blocks, and a predicted value is calculated from thereference picture by taking the direction and quantity of motionindicated by a motion vector into account.

Reference picture lists are provided for two directions. That is, areference picture list L0 that generally registers an encoded picturethat is previous to a picture subject to encoding in time, and areference picture list L1 that generally registers an encoded picturethat is subsequent to the picture subject to encoding in time. Thereference picture list L0 is used for a P picture, and the referencepicture list L0 and the reference picture list L1 are used for a Bpicture.

The direction of motion compensation prediction based on the referencepicture list L0 is referred to as a direction 0, and a direction ofmotion compensation prediction based on the reference picture list L1 isreferred to as a direction 1.

An explanation will be given on a prediction block. A picture is firstdivided in units of macroblocks (hereinafter “MB”) of 16 pixelshorizontally by 16 pixels vertically. A macroblock is further dividedinto one or more prediction blocks of 16 pixels horizontally by 16pixels vertically, 16 pixels horizontally by 8 pixels vertically, 8pixels horizontally by 16 pixels vertically, 8 pixels horizontally by 8pixels vertically, 8 pixels horizontally by 4 pixels vertically, 4pixels horizontally by 8 pixels vertically, or 4 pixels horizontally by4 pixels vertically.

One motion vector that indicates the direction of motion and thequantity of motion and one reference index that indicates a referencepicture in a reference picture list are assigned to a prediction blockof a P picture. One motion vector that indicates the direction of motionand the quantity of motion and one reference index that indicates areference picture in a reference picture list, or two motion vectors andtwo reference indices are assigned to a prediction block of a B picture.

For a prediction block to which one motion vector and one referenceindex are assigned (herein after referred to as “unidirectionalprediction”), the pixel value of a reference picture indicated by themotion vector and the reference index is set as a predicted value. Incontrast, for a prediction block to which two motion vectors and tworeference indices are assigned (herein after referred to as“bidirectional prediction”), an average value of the pixel values ofreference pictures indicated by the motion vectors and the referenceindices respectively is set as a predicted value.

Next, an explanation will be given on a method for deriving a motionvector predictor according to Patent document 1 or MPEG-4AVC as aconventional method for predicting a motion vector while referring toFIG. 1A, FIG. 1B, and FIG. 2 . A “block” refers to a “prediction block”in the following explanation unless otherwise indicated.

A Block A, a block B, and a block C that are blocks neighboring theblock X subject to encoding are determined as shown in FIG. 1A (stepS5000). With respect to block A, the reference index in the direction 0is defined as refIdxL0A, the motion vector in the direction 0 is definedas mvL0A, the reference index in the direction 1 is defined asrefIdxL1A, and the motion vector in the direction 1 is defined as mvL1A.In a similar manner, refIdxL0B, mvL0B, refIdxL1B, and mvL1B for block B,and refIdxL0C, mvL0C, refIdxL1C, and mvL1C for block C are defined.

Whether or not motion compensation prediction in the direction 0 isperformed for the block X subject to encoding is examined (step S5010).

In case that motion compensation prediction in the direction is notperformed (NO in step S5010), with respect to the block X subject toencoding in the direction 0, the reference index refIdxL0X is set as −1,and the motion vector mvL0X is set as (0, 0) (step S5030).

In case that motion compensation prediction in the direction isperformed (YES in step S5010), it is examined whether only one of threereference indices (i.e., refIdxL0A, refIdxL0B, and refIdxL0C) of theneighboring blocks A, B, and C in the direction 0, is identical torefIdxL0X, which is the reference index of the block X subject toencoding (step S5020). In case that there exists only one neighboringblock of which the reference index is identical to that of the block Xsubject to encoding (YES in step S5020), the motion vector mvL0N of theneighboring block N is set as a motion vector predictor mvpL0X of theblock X subject to encoding (step S5040).

In case that no neighboring block exists of which the reference index isidentical to that of the block X subject to encoding, or in case morethan one neighboring blocks exist of which the reference index isidentical to that of the block X (NO in step S5020), median values ofrespective elements of the motion vectors mvL0A, mvL0B, and mvL0C in thedirection 0 of the neighboring blocks A, B, and C are set as the motionvector predictor mvpL0X as shown in the equation 1 (step S5050).

mvpL0X(x)=Median[mvL0A(x),mvL0B(x),mvL0C(x)]

mvpL0X(y)=Median[mvL0A(y),mvL0B(y),mvL0C(y)]  [equation 1]

A similar process is also performed for motion compensation predictionin the direction 1 for the block X subject to encoding (step S5110-stepS5150).

An explanation will be given on problems of the conventional methoddescribed above. In accordance with the conventional method forpredicting a motion vector, a transient value of motion vector predictoris avoided by using a median filter. However, a median filter has aproblem that a most efficient motion vector can not be used as apredicted value.

Therefore, the conventional method for predicting a motion vectorintroduces a scheme before the median filter. According to the scheme,in case that only one neighboring block having a reference indexidentical to that of the block subject to encoding exists for eachprediction direction, the motion vector of the neighboring block ispreferentially set as the motion vector predictor.

Since a motion vector typically depends on the motion of an object, themotion of the object has a correlation in the time direction. However,according to the conventional method for predicting a motion vector,whether the reference index of a block subject to encoding and thereference index of a neighboring block are identical with each other ischecked for each prediction direction independently. Therefore, in casethat a motion of an object having a time correlation different from thatof a motion of a block subject to encoding exists in a neighboringblock, a problem exists that the original motion of the block subject toencoding can not be predicted correctly.

An explanation will be given on a problem of such a conventional methodfor predicting a motion vector with a specific example while referringto FIG. 3 .

The positions of the neighboring block A, block B, and block C withrespect to a block X subject to encoding in a picture subject toencoding is as shown in the figure. Since a same object exists in theblock X subject to encoding and in the block B, bidirectional predictionusing a previous reference picture P0 and a subsequent reference pictureP1 is used for the block X subject to encoding and for the block B. Onthe other hand, an object including the block C has a strong correlationwith the previous reference picture P0, and unidirectional prediction isused. An object including the block A has a strong correlation with thesubsequent reference picture P1, and unidirectional prediction is used.

For the block X subject to encoding, motion compensation predictionwhere the motion vector is (−8, 8) with respect to the reference pictureP0 is performed, and motion compensation prediction where the motionvector is (8, −8) with respect to the reference picture P1 is performed.For the block A, motion compensation prediction where the motion vectoris (0, 0) with respect to the reference picture P1 is performed. For theblock B, motion compensation prediction where the motion vector is (−8,8) with respect to the reference picture P0 is performed, and motioncompensation prediction where the motion vector is (8, −8) with respectto the reference picture P1 is performed. For the block C, motioncompensation prediction where the motion vector is (0, 0) with respectto the reference picture P0 is performed.

In this example, ‘0’ in the reference index in the direction 0 indicatesthe reference picture P0, and ‘0’ in the reference index in thedirection 1 indicates the reference picture P1.

With respect to the block X subject to encoding, the reference indexrefIdxL0X in the direction 0 is 0, the motion vector mvL0X in thedirection 0 is (−8, 8), the reference index refIdxL1X in the direction 1is 0, and the motion vector mvL1B in the direction 1 is (8, −8).

With respect to the neighboring block A, the reference index refIdxL0Ain the direction 0 is −1, the motion vector mvL0A in the direction 0 is(0, 0), the reference index refIdxL1A in the direction 1 is 0, and themotion vector mvL1A in the direction 1 is (0, 0).

With respect to the block B, the reference index refIdxL0B in thedirection 0 is 0, the motion vector mvL0B in the direction 0 is (−8, 8),the reference index refIdxL1B in the direction 1 is 0, and the motionvector mvL1B in the direction 1 is (8, −8).

With respect to the block C, the reference index refIdxL0C in thedirection 0 is 0, the motion vector mvL0C in the direction 0 is (0, 0),the reference index refIdxL1C in the direction 1 is −1, and the motionvector mvL1C in the direction 1 is (0, 0).

The reason why refIdxL0A is −1, mvL0A is (0, 0), refIdxL1C is −1a, andmvL1C is (0, 0) is that the block A and the block C are forunidirectional prediction.

According to the conventional method for predicting a motion vectordescribed above, with respect to the direction 0 for the block X subjectto encoding, there exist two indices as a reference index having a valueidentical to the reference index refIdxL0X of the block X subject toencoding, namely the reference index refIdxL0B of the block B and thereference index refIdxL0C of the block C. Therefore, the motion vectorpredictor mvpL0X is derived as (0, 0) by calculating the median valuesof respective elements of the motion vectors mvL0A, mvL0B, and mvL0C ofthe neighboring blocks A, B, and C in the direction 0 as shown in theequation 2.

mvpL0X=(Median[0,−8,0],Median[0,8,0])=(0,0)  [equation 2]

In this process, the motion vector difference dmvL0X is derived as (−8,8) by calculating the difference between the motion vector mvL0X of theblock X subject to encoding and the motion vector predictor mvpL0X asshown in the equation 3.

dmvL0X=mvL0X−mvpL0X=(−8−0,8−0)=(−8,8)  [equation 3]

In a similar manner, with respect to the direction 1 for the block Xsubject to encoding, there exist two indices as a reference index havinga value identical to the reference index refIdxL1X of the block Xsubject to encoding, namely the reference index refIdxL1A of the block Aand the reference index refIdxL1B of the block B. Therefore, the motionvector predictor mvpL1X is derived as (0, 0) by calculating the medianvalues of respective elements of the motion vectors mvL1A, mvL1B, mvL1Cof the neighboring blocks A, B, and C in the direction 1 as shown in theequation 4.

mvpL1X=(Median[0,8,0],Median[0,−8,0])=(0,0)  [equation 4]

In this process, the motion vector difference dmvL1X is derived as (8,−8) by calculating the difference between the motion vector mvL1X of theblock X subject to encoding and the motion vector predictor mvpL1X asshown in equation 5.

dmvL1X=mvL1X−mvpL1X=(8−0,−8−0)=(8,−8)  [equation 5]

As described above, the block X subject to encoding, to whichbidirectional prediction has applied, has originally a high correlationwith the neighboring block B that is a sole neighboring block to whichbidirectional prediction has applied in a similar manner. However, thereexists another neighboring block that has an identical reference indexother than the neighboring block B in case the identity of referenceindex is determined independently for each prediction direction.Therefore, according to the conventional method for predicting a motionvector, a motion vector predictor is inevitably derived based on anintermediate value of all of the neighboring blocks for each predictiondirection, and an accurate motion vector predictor can not be derived.Thus encoding with reduced redundancy of a motion vector of a blocksubject to encoding can not be performed.

In the light of the presupposed technology and the conventionaltechnology described above, an explanation will be given below on afirst embodiment of the present invention.

FIG. 4 shows a configuration of a moving picture encoding device using amethod for predicting a motion vector according to the first embodiment.The moving picture encoding device includes a subtraction unit 100, aprediction error encoding unit 110, a bitstream generation unit 120, aprediction error decoding unit 130, an addition unit 140, a motioncompensation prediction method determination unit 150, a frame memory160, a motion vector encoding unit 170, a motion information storage180, and a motion vector number derivation unit 190.

First, an explanation will be given on the flow of moving pictureencoding process performed by the moving picture encoding device.

Encoding is performed in units of macroblocks. An input picture 10 isdivided into units of macroblocks, and provided for the subtraction unit100 and the motion compensation prediction method determination unit150.

From a macroblock subject to encoding and from reference picturesprovided from the frame memory 160, the motion compensation predictionmethod determination unit 150 detects a motion vector for each referencepicture by using a technique, such as a block matching technique or thelike. The motion compensation prediction method determination unit 150determines a most appropriate motion compensation prediction method fromthe detected motion vectors by using rate distortion optimization or thelike, and generates a prediction picture.

The motion compensation prediction method determination unit 150provides the subtraction unit 100 and the addition unit 140 with theprediction picture generated by using the determined motion compensationprediction method. Further, the motion compensation prediction methoddetermination unit 150 sends a reference index and a motion vectorcorresponding to the determined motion compensation prediction method tothe motion information storage 180.

In this specification, the determination of a motion compensationprediction method refers to the determination of: a method for dividinga macroblock into one or more prediction blocks; a method for predictingwith respect to the divided prediction block (unidirectionalprediction/bidirectional prediction); and a reference picture (referenceindex) for each prediction direction.

The subtraction unit 100 calculates a prediction error from a differencebetween the macroblock subject to encoding and the prediction pictureprovided from the motion compensation prediction method determinationunit 150, and provides the prediction error to the prediction errorencoding unit 110.

The prediction error encoding unit 110 performs a process such as anorthogonal transformation, quantization, or the like on the predictionerror provided from the subtraction unit 100 so as to transform theprediction error to prediction error encoding data, and provides theprediction error encoding data to the bitstream generation unit 120 andto the prediction error decoding unit 130.

The prediction error decoding unit 130 performs a process such asinverse quantization, an inverse orthogonal transformation, or the likeon the prediction error encoding data provided from the prediction errorencoding unit 110 so as to transform the prediction error encoding datato a prediction error, and provides the prediction error to the additionunit 140.

The addition unit 140 calculates a decoded picture by adding theprediction error provided from the prediction error decoding unit 130and the prediction picture provided from the motion compensationprediction method determination unit 150, and provides the decodedpicture to the frame memory 160.

The frame memory 160 stores as a reference picture the decoded pictureprovided from the addition unit 140 and provides the reference pictureto the motion compensation prediction method determination unit 150.

The motion information storage 180 stores the motion vector and thereference index provided from the motion compensation prediction methoddetermination unit 150 and provides the motion vector and the referenceindex to the motion vector encoding unit 170. The motion informationstorage 180 has stored motion vectors and reference indices with respectto all macroblocks of the input picture, and provides the motion vectorencoding unit 170 with the motion vector and the reference index of amacroblock neighboring the macroblock subject to encoding.

According to the first embodiment, the motion information storage 180has stored the motion vectors and the reference indices with respect toall macroblocks of the input picture. However, the purpose of the motioninformation storage 180 is to provide the motion vector encoding unit170 with the motion vector and the reference index of a macroblockneighboring the macroblock subject to encoding. Therefore, as far as thepurpose is fulfilled, the motion information storage 180 does not haveto store motion vectors and the reference indices with respect to allmacroblocks of the input picture, but is merely required to storenecessary motion vectors and reference indices.

The motion vector encoding unit 170 calculates a motion vector predictorfrom: the motion vector and the reference index of the macroblocksubject to encoding and the motion vector and the reference index of theneighboring macroblock provided from the motion information storage 180;and a motion vector number of the macroblock subject to encoding and theneighboring macroblock provided from the motion vector number derivationunit 190. The motion vector encoding unit 170 calculates a motion vectordifference from the motion vector of the macroblock subject to encodingand from the motion vector predictor, transforms the motion vectordifference to motion vector difference encoding data, and provides thebitstream generation unit 120 therewith. The detailed description on themethod for predicting a motion vector will be given later.

The bitstream generation unit 120 transforms the prediction errorencoding data provided from the prediction error encoding unit 110 andthe motion vector difference encoding data provided from the motionvector encoding unit 170 to an output bitstream together with othercontrol information or the like, and outputs the output bitstream.

The motion vector number derivation unit 190 derives a motion vectornumber for each macroblock from the motion information storage 180, andprovides the motion vector encoding unit 170 with the motion vectornumbers of the macroblock subject to encoding and of the neighboringmacroblock.

With respect to the derivation of the motion vector number, it is alsopossible to derive the motion vector number, for example, frominformation indicating a motion compensation prediction methoddetermined by the motion compensation prediction method determinationunit 150 as well as to derive the motion vector number for eachmacroblock from the motion information storage 180.

FIG. 5 shows a detailed configuration of the motion vector numberderivation unit 190 and the motion vector encoding unit 170 in FIG. 4 .

The motion vector number derivation unit 190 includes an encoding targetblock motion vector number derivation unit 210, a neighboring blockmotion vector number derivation unit 220, and a neighboring blockidentifying unit 230.

The motion vector encoding unit 170 includes a motion vector predictorderivation unit 240, a motion vector difference calculation unit 250,and a motion vector difference encoding unit 260.

The encoding target block motion vector number derivation unit 210derives the number of motion vectors of the block subject to encodingfrom the motion information storage 180. The neighboring blockidentifying unit 230 refers to the motion information storage 180 andidentifies a plurality of encoded neighboring blocks that are located inadjacent areas of the block subject to encoding. The neighboring blockmotion vector number derivation unit 220 derives the number of motionvectors of the identified neighboring blocks from the motion informationstorage 180.

The motion vector predictor derivation unit 240 receives from theneighboring block identifying unit 230 information on the referenceindex and the motion vector of the plurality of neighboring blocks,receives from the encoding target block motion vector number derivationunit 210 the motion vector number of the block subject to encoding, andreceives from the neighboring block motion vector number derivation unit220 the motion vector number of the neighboring blocks.

In case that only one neighboring block exists among the plurality ofneighboring blocks that has a motion vector number identical to themotion vector number of the block subject to encoding, the motion vectorpredictor derivation unit 240 identifies the neighboring block as aprediction block candidate and provides the motion vector differencecalculation unit 250 with the motion vector of the prediction blockcandidate as a motion vector predictor MVP.

The motion vector difference calculation unit 250 calculates a motionvector difference MVD on the basis of the difference between the motionvector MV of the block subject to encoding that is read from the motioninformation storage 180 and the motion vector predictor MVP receivedfrom the motion vector predictor derivation unit 240, and provides themotion vector difference MVD to the motion vector difference encodingunit 260.

The motion vector difference encoding unit encodes the motion vectordifference MVD and provides the bitstream generation unit 120 with theencoded motion vector difference MVD.

Next, an explanation will be given on a method for deriving a motionvector predictor according to the first embodiment while referring toFIG. 1A, FIG. 1B, FIG. 2 , and FIG. 6 . The derivation of the motionvector predictor is processed in units of prediction blocks in themacroblock subject to encoding. In the method for deriving a motionvector predictor according to the first embodiment, a first motionvector predictor derivation process is performed as a preceding step,and a second motion vector predictor derivation process is performed asa following step, accordingly. The second motion vector predictorderivation process is applied in a similar manner as that of theconventional motion vector predictor derivation process explained byFIGS. 1A and 1B.

An explanation will be given on the first motion vector predictorderivation process in the preceding step.

First, the neighboring block identifying unit 230 determines the blockA, the block B, and the block C that are blocks neighboring the block Xsubject to encoding as shown in FIG. 1A (step S1000).

Next, the neighboring block motion vector number derivation unit 220derives the motion vector number of the block A, the motion vectornumber of the block B, and the motion vector number of the block C. Themotion vector predictor derivation unit 240 examines whether only oneneighboring block N that has a motion vector number identical to amotion vector number of the block X subject to encoding exists among theneighboring blocks A, B, and C (step S1100).

In case that only one neighboring block N that has the motion vectornumber identical to that of the block X subject to encoding exists (YESin step S1100), the motion vector predictor derivation unit 240identifies the neighboring block as a prediction block candidate, andexamines whether the motion vector number of the block X subject toencoding is 2 (step S1200).

In case that only one neighboring block N has the motion vector numberidentical to that of the block X subject to encoding, and that themotion vector number of the block X subject to encoding is 2 (YES instep S1200), the motion vector of the neighboring block N is set as themotion vector predictor of the block X subject to encoding in the bothdirections (the previous direction L0 and the subsequent direction L1)as shown in equation 6 (step S1300).

mvpL0X=mvL0N

mvpL1X=mvL1N  [equation 6]

In case that only one neighboring block N has the motion vector numberidentical to that of the block X subject to encoding, and that themotion vector number of the block X subject to encoding is not 2 (NO instep S1200), the motion vector of the neighboring block N in a singleprediction direction (the previous direction L0 or the subsequentdirection L1) is set as the motion vector predictor of the block Xsubject to encoding as shown in equation 7 (step S1400). The singleprediction direction Z is a direction where a motion vector exists.

mvpLZX=mvLZN  [equation 7]

In case that no neighboring block has the motion vector number identicalto that of the block X subject to encoding, or more than one neighboringblocks have the motion vector number identical to that of the block Xsubject to encoding (NO in S1000), the conventional process of step 5000and the following steps is executed as the second motion vectorpredictor derivation process.

According to the explanation given above, the block A, the block B, andthe block C, which are neighboring blocks, are located at the positionsshown in FIG. 1A. However, the positions of the neighboring blocks arenot limited to the positions shown in FIG. 1A, but any position can beadopted as far as a block at the position has been encoded. Further, thenumber of the neighboring blocks is not necessarily three but any numbermore than or equal to two can be adopted. Further, a neighboring blockis not limited to a block that is spatially adjacent to the blocksubject to encoding in the same picture, but may be a block at the sameposition as or adjacent to a block subject to encoding in a referencepicture that is encoded right before, wherein the block subject toencoding in the reference picture is temporally adjacent to the blocksubject to encoding in the present picture.

Although step 5000 and the following steps are executed as the secondmotion vector predictor derivation process according to the firstembodiment, the second motion vector predictor derivation process is notlimited to the process of step 5000 and the following steps. Forexample, in case that two or more neighboring blocks have a motionvector number identical to that of the block X subject to encoding, amotion vector of one of the plurality of neighboring blocks having amotion vector number identical to that of the block X subject toencoding may be set as the motion vector predictor. Alternatively, aweighted mean average of the motion vectors of the plurality ofneighboring blocks having the motion vector number identical to that ofthe block X subject to encoding may be calculated and set as the motionvector predictor. In a similar manner, also in case that no neighboringblock has the motion vector number identical to that of the block Xsubject to encoding, a motion vector of one of the plurality ofneighboring blocks may be set as the motion vector predictor, or aweighted mean average of the motion vectors of the plurality ofneighboring blocks may be calculated and set as the motion vectorpredictor.

Next, an explanation will be given on advantages of the method forderiving a motion vector predictor according to the first embodiment.

It is assumed that the method for deriving a motion vector predictoraccording to the first embodiment is applied to the specific exampleexplained by FIG. 3 . The only one neighboring block that has the motionvector number 2, which is identical to that of the block X subject toencoding, is the block B. Therefore, the motion vector predictors mvpL0Xand mvpL1X of the block X subject to encoding are derived from theequation 8 as (−8, 8) and (8, −8), respectively.

mvpL0X=mvL0B=(−8,8)

mvpL1X=mvL1B=(8,−8)  [equation 8]

In this process, the motion vector differences dmvL0X and dmvL0X arederived from the equation 9 as (0, 0) and (0, 0), respectively.

dmvpL0X=mvL0X−mvpL0X=(−8,8)−(−8,8)=(0,0)

dmvpL1X=mvL0X−mvpL0X=(8,−8)−(8,−8)=(0,0)  [equation 9]

As described above, according to the method for deriving a motion vectorpredictor of the first embodiment, the motion vector of a neighboringblock that has a motion vector number identical to the motion vectornumber of a block subject to encoding is set as the motion vectorpredictor. This allows derivation of the motion vector predictoraccording to an original motion and encoding with reduced redundancy ofthe motion vector of the block subject to encoding, even in case that amotion of an object having a time correlation different from that of amotion of the block subject to encoding exists in a neighboring block.

FIG. 7 shows a configuration of a moving picture decoding device using amethod for predicting a motion vector according to the first embodiment.The moving picture decoding device includes a bitstream analysis unit500, a prediction error decoding unit 510, an addition unit 520, amotion compensation prediction unit 530, a frame memory 540, a motionvector decoding unit 550, a motion information storage 560, and a motionvector number derivation unit 570.

First, an explanation will be given on the flow of moving picturedecoding process performed by the moving picture decoding device.

Decoding is performed in units of macroblocks. An input bitstream 10 isprovided to the bitstream analysis unit 500.

The bitstream analysis unit 500 decodes and derives prediction errorencoding data, a motion vector difference, a reference index, and amacroblock type from the input bitstream 10. In units of predictionblocks, the bitstream analysis unit 500 provides the prediction errorencoding data to the prediction error decoding unit 510, the motionvector difference and the reference index to the motion vector decodingunit 550, and the macroblock type to the motion vector number derivationunit 570.

For example in case that the macroblock consists of four predictionblocks, the following process is to be repeated four times in themacroblock.

The prediction error decoding unit 510 performs a process such asinverse quantization, an inverse orthogonal transformation, or the likeon the prediction error encoding data provided from the bitstreamanalysis unit 500 so as to transform the prediction error encoding datato a prediction error, and provides the prediction error to the additionunit 520.

The motion vector decoding unit 550 calculates a motion vector predictorby using: the motion vector difference and the reference index of themacroblock subject to decoding provided from the bitstream analysis unit500; the motion vector number of the macroblock subject to decoding anda neighboring macroblock provided from the motion vector numberderivation unit 570; and the motion vector and the reference index ofthe neighboring macroblock provided from the motion information storage560. The motion vector decoding unit 550 decodes the motion vector fromthe motion vector difference and the motion vector predictor of themacroblock subject to decoding, and provides the decoded motion vectorand the reference index to the motion compensation prediction unit 530and to the motion information storage 560. The detailed description onthe method for decoding a motion vector will be given later.

The motion information storage 560 stores the motion vector and thereference index provided from the motion vector decoding unit 550 andprovides the motion vector decoding unit 550 with the stored motionvector and the stored reference index as necessary.

The motion vector number derivation unit 570 derives a motion vectornumber for each macroblock from the macroblock type provided from thebitstream analysis unit 500 and provides the motion vector decoding unit550 with the motion vector number of the macroblock subject to decodingand the neighboring macroblock.

With respect to the derivation of the motion vector number, it is alsopossible to determine based on the number of motion vector differences,the number of reference indices, or the like as well as to derive themotion vector number from the macroblock type.

The motion compensation prediction unit 530 generates a predicted valueby using: the motion vector and the reference index provided from themotion vector decoding unit 550; and the reference picture provided fromthe frame memory 540, and provides the addition unit 520 with thepredicted value.

The addition unit 520 adds the prediction error provided from theprediction error decoding unit 510 and the prediction error provide fromthe motion compensation prediction unit 530 so as to generates a decodedvalue. The addition unit 520 provides the frame memory 540 with thedecoded value and outputs the decoded value as an picture output 60.

The frame memory 540 stores the decoded picture provided from theaddition unit 520, and provides the motion compensation prediction unit530 with the stored decoded picture as a reference picture as necessary.

FIG. 8 shows a detailed configuration of the motion vector numberderivation unit 570 and the motion vector decoding unit 550 in FIG. 7 .

The motion vector number derivation unit 570 includes a decoding targetblock motion vector number derivation unit 610, a neighboring blockmotion vector number derivation unit 620, and a neighboring blockidentifying unit 630.

The motion vector decoding unit 550 includes a motion vector predictorderivation unit 640 and a motion vector calculation unit 650.

The decoding target block motion vector number derivation unit 610derives from the bitstream analysis unit 500 the number of motionvectors of a block subject to decoding. The neighboring blockidentifying unit 630 refers to the motion information storage 560 andidentifies a plurality of decoded neighboring blocks that are located inadjacent areas of the block subject to decoding. The neighboring blockmotion vector number derivation unit 620 derives the number of motionvectors of each of the identified neighboring blocks from the motioninformation storage 560.

The motion vector predictor derivation unit 640 receives from theneighboring block identifying unit 630 information on the referenceindex and the motion vector of the plurality of neighboring blocks,receives from the decoding target block motion vector number derivationunit 610 the motion vector number of the block subject to decoding, andreceives from the neighboring block motion vector number derivation unit620 the motion vector number of the neighboring blocks.

In case that only one neighboring block exists among the plurality ofneighboring blocks that has a motion vector number identical to themotion vector number of the block subject to decoding, the motion vectorpredictor derivation unit 640 identifies the neighboring block as aprediction block candidate and provides the motion vector calculationunit 650 with the motion vector of the prediction block candidate as amotion vector predictor MVP.

The motion vector calculation unit 650 calculates a motion vector MV byadding the motion vector difference MVD of the block subject to decodingreceived from the bitstream analysis unit 500 and the motion vectorpredictor MVP received from the motion vector predictor derivation unit640, and provides the motion vector MV to the motion compensationprediction unit 530.

The method for deriving a motion vector predictor by the moving picturedecoding device according to the first embodiment is same as the methodfor deriving a motion vector predictor by the moving picture encodingdevice according to the first embodiment provided that the “blocksubject to encoding” is replaced with “block subject to decoding.”Therefore, the detailed explanation thereof is omitted.

Next, an explanation will be given on a second embodiment of the presentinvention.

FIG. 9 shows a configuration of a moving picture encoding device using amethod for predicting a motion vector according to the secondembodiment. The moving picture encoding device includes a subtractionunit 100, a prediction error encoding unit 110, a bitstream generationunit 120, a prediction error decoding unit 130, an addition unit 140, amotion compensation prediction method determination unit 150, a framememory 160, a motion vector encoding unit 170, a motion informationstorage 180, a motion vector number derivation unit 190, and amacroblock border determination unit 200.

The subtraction unit 100, the prediction error encoding unit 110, thebitstream generation unit 120, the prediction error decoding unit 130,the addition unit 140, the motion compensation prediction methoddetermination unit 150, the frame memory 160, the motion informationstorage 180, and the motion vector number derivation unit 190 accordingto the second embodiment are same as the elements in the firstembodiment with the same numerical references. An explanation will begiven on the motion vector encoding unit 170 and the macroblock borderdetermination unit 200 that are different from the constituting elementsof the first embodiment while referring to FIG. 9 and FIG. 10 .

The macroblock border determination unit 200 determines whether or not ablock subject to encoding has contact with a macroblock border. If theblock subject to encoding has contact with the macroblock border, themacroblock border determination unit 200 sets a macroblock border flagto 1, and if the block subject to encoding does not have contact withthe macroblock border, the macroblock border determination unit 200 setsa macroblock border flag to 0 and provides the macroblock border flag tothe motion vector encoding unit 170.

Whether or not to have contact with the macroblock border can bedetermined, for example, by using a prediction block number. Anexplanation on the prediction block number will be given later.

The motion vector encoding unit 170 calculates a motion vector predictoron the basis of: the motion vector and the reference index of themacroblock subject to encoding and the motion vector and the referenceindex of the neighboring macroblock provided from the motion informationstorage 180; the motion vector number provided from the motion vectornumber derivation unit 190; and the macroblock border flag provided fromthe macroblock border determination unit 200. The motion vector encodingunit 170 calculates a motion vector difference from the motion vector ofthe macroblock subject to encoding and of the motion vector predictor,transforms the motion vector difference to motion vector differenceencoding data, and provides the bitstream generation unit 120 therewith.

A detailed explanation will be given on a method for predicting a motionvector predictor according to the second embodiment while referring toFIG. 1A, FIG. 1B, and FIG. 10 .

First, the neighboring block identifying unit 230 determines the blockA, the block B, the block C, and the block D that are blocks neighboringthe block X subject to encoding as shown in FIG. 1B (step S2000).

Next, the macroblock border determination unit 200 examines the value ofthe macroblock border flag (step S2100).

If the macroblock border flag is 1 (YES in step S2100), the neighboringblock motion vector number derivation unit 220 derives the motion vectornumber of the block A, block B, block C, and the block D. The motionvector predictor derivation unit 240 examines whether only oneneighboring block N that has the motion vector number identical to themotion vector number of the block X subject to encoding exists among theneighboring blocks A, B, C, and D (step S2200). After the step 2200, theprocess of step 1200 and the following steps of the first embodiment isexecuted.

If the macroblock border flag is 0 (NO in step S2100), the process ofstep 5000 and the following steps is executed as the second motionvector predictor derivation process as explained in the firstembodiment.

An explanation will be given on advantages of the method for predictinga motion vector predictor according to the second embodiment by usingFIGS. 11A-11E.

First, an explanation will be given on the prediction block number. FIG.11A shows a prediction block number in case that a macroblock is dividedinto four prediction blocks of eight by eight.

As shown in FIG. 11B, there is a block E, which does not have contactwith the macroblock border and of which the prediction block number is3. In case that the block E includes an object identical to that ofother block(s) in the macroblock and indicates same motion, the block Eis likely to be encoded as one block X as shown in FIG. 11C, FIG. 11D,or FIG. 11E with a high probability. Therefore, in case that the block Eexists as an independent prediction block, the likelihood that the blockE and other block(s) in the macroblock include a same object andindicates same motion is low. Therefore, in such a case, it ispreferable not to execute determination based on motion vector numbersand preferable to proceed to the second motion vector predictorderivation process, which allows a transient motion vector to beeliminated.

For a prediction block that does not have contact with the macroblockborder, such as the block E, a neighboring block exists in the samemacroblock. Therefore, the condition that the prediction block has notcontact with a macroblock border can also be expressed as “a neighboringblock is in the same macroblock” in other words.

According to the method for deriving a motion vector predictor accordingto the embodiment, in case that the block subject to encoding hascontact with a macroblock border, the motion vector number of the blocksubject to encoding and the motion vector number of the neighboringblock are taken into account, and in case that the block subject toencoding does not have contact with the macroblock border, the motionvector number of the block subject to encoding and the motion vectornumber of the neighboring block are not taken into account. This allowsthe decrease of false detections and allows the derivation of a motionvector predictor according to the original motion.

FIG. 12 shows a configuration of a moving picture decoding device usinga method for predicting a motion vector according to the secondembodiment. The moving picture decoding device includes a bitstreamanalysis unit 500, a prediction error decoding unit 510, an additionunit 520, a motion compensation prediction unit 530, a frame memory 540,a motion vector decoding unit 550, a motion information storage 560, amotion vector number derivation unit 570, and a macroblock borderdetermination unit 580.

The prediction error decoding unit 510, the addition unit 520, themotion compensation prediction unit 530, the frame memory 540, themotion information storage 560, and the motion vector number derivationunit 570 according to the second embodiment are as same as the elementsin the first embodiment with the same numerical references. Anexplanation will be given on the bitstream analysis unit 500, the motionvector decoding unit 550, and the macroblock border determination unit580 that are different from the constituting elements of the firstembodiment.

The bitstream analysis unit 500 decodes and derives prediction errorencoding data, a motion vector difference, a reference index, and amacroblock type from the input bitstream 10. In units of predictionblocks, the bitstream analysis unit 500 provides the prediction errorencoding data to the prediction error decoding unit 510, the motionvector difference and the reference index to the motion vector decodingunit 550, the macroblock type to the motion vector number derivationunit 570, and the prediction block number to the macroblock borderdetermination unit 580.

The macroblock border determination unit 580 determines based on theprediction block number provided from the bitstream analysis unit 500whether or not a block subject to decoding has contact with a macroblockborder. If the block subject to decoding has contact with the macroblockborder, the macroblock border determination unit 580 sets a macroblockborder flag to 1, and if the block subject to decoding does not havecontact with the macroblock border, the macroblock border determinationunit 580 sets a macroblock border flag to 0 and provides the macroblockborder flag to the motion vector decoding unit 550.

The motion vector decoding unit 550 calculates a motion vector predictorby using: the motion vector difference and the reference index of themacroblock subject to decoding provided from the bitstream analysis unit500; the motion vector number of the macroblock subject to decoding anda neighboring macroblock provided from the motion vector numberderivation unit 570; the macroblock border flag provided from themacroblock border determination unit 580; and the motion vector and thereference index of the neighboring block provided from the motioninformation storage 560. The motion vector decoding unit 550 decodes themotion vector from the motion vector difference and the motion vectorpredictor of the macroblock subject to decoding, and provides thedecoded motion vector and reference index to the motion compensationprediction unit 530 and to the motion information storage 560.

The method for deriving a motion vector predictor by the moving picturedecoding device according to the second embodiment is same as the methodfor deriving a motion vector predictor by the moving picture encodingdevice according to the second embodiment provided that the “blocksubject to encoding” is replaced with “block subject to decoding.”Therefore, the detailed explanation thereof is omitted.

Next, before an explanation on a third embodiment is given, anexplanation will be given on a problem of the conventional method forpredicting a motion vector with another specific example while referringto FIG. 13 .

The positions of the neighboring block A, block B, and block C relativeto the block X subject to encoding is as shown in the figure. In thisexample, two previous reference pictures P0 and P1 and one subsequentreference picture P2 are used with respect to the picture subject toencoding. Since a same object exists in the block X subject to encodingand in the block B, bidirectional prediction using a previous referencepicture P1 and a subsequent reference picture P2 is used for the block Xsubject to encoding and for the block B. On the other hand,bidirectional prediction based on the previous reference picture P0 andthe subsequent reference picture P2 is used for an object including theblock A, and unidirectional prediction based on the previous referencepicture P1 is used for an object including the block C.

For the block X subject to encoding, motion compensation predictionwhere the motion vector is (−8, 8) with respect to the reference pictureP1 is performed, and motion compensation prediction where the motionvector is (8, −8) with respect to the reference picture P2 is performed.For the block A, motion compensation prediction where the motion vectoris (0, 0) with respect to the reference picture P0 is performed, andmotion compensation prediction where the motion vector is (0, 0) withrespect to the reference picture P2 is performed. For the block B,motion compensation prediction where the motion vector is (−8, 8) withrespect to the reference picture P1 is performed, and motioncompensation prediction where the motion vector is (8, −8) with respectto the reference picture P2 is performed. For the block C, motioncompensation prediction where the motion vector is (0, 0) with respectto the reference picture P1 is performed.

In this example, ‘0’ in the reference index in the direction 0 indicatesthe reference picture P1, ‘1’ in the reference index in the direction 0indicates the reference picture P0, and ‘0’ in the reference index inthe direction 1 indicates the reference picture P2.

With respect to the block X subject to encoding, the reference indexrefIdxL0X in the direction 0 is 0, the motion vector mvL0X in thedirection 0 is (−8, 8), the reference index refIdxL1X in the direction 1is 0, and the motion vector mvL1B in the direction 1 is (8, −8).

With respect to the neighboring block A, the reference index refIdxL0Ain the direction 0 is 1, the motion vector mvL0A in the direction 0 is(0, 0), the reference index refIdxL1A in the direction 1 is 0, and mvL1Ain the direction 1 is (0, 0).

With respect to the neighboring block B, the reference index refIdxL0Bin the direction 0 is 0, the motion vector mvL0B in the direction 0 is(−8, 8), the reference index refIdxL1B in the direction 1 is 0, and themotion vector mvL1B in the direction 1 is (8, −8).

With respect to the neighboring block C, the reference index refIdxL0Cin the direction 0 is 0, the motion vector mvL0C in the direction 0 is(0, 0), the reference index refIdxL1C in the direction 1 is −1, and themotion vector mvL1C in the direction 1 is (0, 0).

According to the conventional method for predicting a motion vector,with respect to the direction 0 for the block X subject to encoding,there exist two indices as a reference index having a value identical tothe reference index refIdxL0X of the block X subject to encoding, namelythe reference index refIdxL0B of the block B and the reference indexrefIdxL0C of the block C. Therefore, the motion vector predictor mvpL0Xis derived as (0, 0) by calculating the median values of respectiveelements of the motion vectors mvL0A, mvL0B, and mvL0C of theneighboring blocks A, B, and C in the direction 0 as shown in theequation 10.

mvpL0X=(Median[0,−8,0],Median[0,8,0])=(0,0)  [equation 10]

In this process, dmvL0X, which is the motion vector difference, isderived as (−8, 8) by calculating the difference between the motionvector mvL0X of the block X subject to encoding and the motion vectorpredictor mvpL0X as shown in the equation 11.

dmvL0X=mvL0X−mvpL0X=(−8−0,8−0)=(−8,8)  [equation 11]

In a similar manner, with respect to the direction 1 for the block Xsubject to encoding, there exist two indices as a reference index havinga value identical to the reference index refIdxL1X of the block Xsubject to encoding, namely the reference index refIdxL1A of the block Aand the reference index refIdxL1B of the block B. Therefore, the motionvector predictor mvpL1X is derived as (0, 0) by calculating the medianvalues of respective elements of the motion vectors mvL1A, mvL1B, mvL1Cof the neighboring blocks A, B, and C in the direction 1 as shown in theequation 12.

mvpL1X=(Median[0,8,0],Median[0,−8,0])=(0,0)  [equation 12]

In this process, the motion vector difference dmvL1X is derived as (8,−8) by calculating the difference between the motion vector mvL1X of theblock X subject to encoding and the motion vector predictor mvpL1X asshown in equation 12.

dmvL1X=mvL1X−mvpL1X=(8−0,−8−0)=(8,−8)  [equation 13]

As described above, the block X subject to encoding to whichbidirectional prediction has applied has originally a high correlationwith the neighboring block B that is a sole neighboring block to whichbidirectional prediction has applied in a similar manner. However, thereexist another neighboring block that has an identical reference indexother than the neighboring block B in case the identity of referenceindex is determined independently for each prediction direction.Therefore, according to the conventional method for predicting a motionvector, a motion vector predictor is inevitably calculated based on anintermediate value of all of the neighboring blocks for each predictiondirection. Thus, an accurate motion vector predictor can not be derivedand encoding with reduced redundancy of a motion vector of a blocksubject to encoding can not be performed.

In this case, even if the identity of motion vector number of the blocksubject to encoding and of a neighboring block is evaluated by using themethod for predicting a motion vector according to the first embodimentor the second embodiment, the second process of predicting a motionvector is executed all the same because there exist two neighboringblocks having a vector number 2 which is identical with that of theblock subject to encoding, namely the block A and the block B. Thisbrings the same result with that of the conventional method forpredicting a motion vector, thus encoding with reduced redundancy of amotion vector of a block subject to encoding can not be performed.

In order to address such additional problems, method for predicting amotion vector that takes the identity of reference pictures between ablock subject to encoding and a neighboring block into account as wellas the identity of motion vector numbers therebetween is used accordingto the third embodiment of the present invention.

A detailed explanation will be given below on the third embodiment ofthe present invention.

The configurations of a moving picture encoding device and a movingpicture decoding device that use the method for predicting a motionvector according to the third embodiment are same as those of the movingpicture encoding device and the moving picture decoding device accordingto the first embodiment. An explanation will be given on a motion vectorencoding unit 170 and a motion vector decoding unit 550 that operatedifferently from that of the constituting elements of the firstembodiment while referring to FIG. 14 . In case of the motion vectordecoding unit 550, “block subject to encoding” is replaced with “blocksubject to decoding” in the following explanation.

An explanation will be given on the process of step 1200 and thefollowing steps that is different from that of the first embodiment.

In case that only one neighboring block N that has the motion vectornumber identical to that of the block X subject to encoding exists, themotion vector predictor derivation unit 240 examines whether the motionvector number of the block X subject to encoding is 2 (step S1200).

If the motion vector number of the block X subject to encoding is 2 (YESin step S1200), the motion vector predictor derivation unit 240 examineswhether the reference index refIdxL0X in the direction L0 of the block Xsubject to encoding is identical to the reference index refIdxL0N of theneighboring block N in the direction L0, and whether the reference indexrefIdxL1X in the direction L1 of the block X subject to encoding isidentical to the reference index refIdxL1N of the neighboring block N inthe direction L1 (step S3000).

In case that the requirement of step S3000 is satisfied, the process ofstep S1300 is executed in a similar manner as that of the firstembodiment. That is, the motion vector of the neighboring block N is setas the motion vector predictor of the block X subject to encoding in theboth directions (the previous direction L0 and the subsequent directionL1). In case that the requirement of step S3000 is not satisfied, aprocess of step 5000 and the following steps are executed, which is theconventional method for predicting a motion vector.

If the motion vector number of the block X subject to encoding is not 2(NO in step S1200), the motion vector predictor derivation unit 240examines whether the reference index refIdxLZX in a single predictiondirection Z (the previous direction L0 or the subsequent direction L1)of the block X subject to encoding is identical to the reference indexrefIdxLZX of the neighboring block N in the direction LZ (step S3100).

In case that the requirement of step S3100 is satisfied, the process ofstep S1400 is executed in a similar manner as that of the firstembodiment. That is, the motion vector of the neighboring block N in thesingle prediction direction Z is set as the motion vector predictor ofthe block X subject to encoding. In case that the requirement of stepS3100 is not satisfied, a process of step 5000 and the following stepsare executed, which is the conventional method for predicting a motionvector.

An explanation will be given on advantages of the method for deriving amotion vector predictor according to the third embodiment.

It is assumed that the method for deriving a motion vector predictoraccording to the third embodiment is applied to the specific exampleexplained by FIG. 13 . Although two neighboring blocks, namely the blockA and the block B, exist that have the motion vector number 2 identicalto that of the block X subject to encoding, only block B has the samereference indices for both directions. Therefore, the motion vectorpredictors mvpL0X and mvpL1X of the block X subject to encoding arederived from the equation 14 as (−8, 8) and (8, −8), respectively.

mvpL0X=mvL0B=(−8,8)

mvpL1X=mvL1B=(8,−8)  [equation 14]

In this process, the motion vector differences dmvL0X and dmvL1X arederived from the equation 15 as (0, 0) and (0, 0), respectively.

dmvpL0X=mvL0X−mvpL0X=(−8,8)−(−8,8)=(0,0)

dmvpL1X=mvL0X−mvpL0X=(8,−8)−(8,−8)=(0,0)  [equation 15]

As described above, according to the method for deriving a motion vectorpredictor of the third embodiment, even in case that a plurality ofneighboring blocks exist that have a motion vector number identical tothe motion vector number of a block subject to encoding, whether thereference indices of respective prediction directions are identical witheach other, that is, whether the reference pictures of the block subjectto encoding and the neighboring block are identical with each other istaken into account. This allows derivation of a motion vector predictoraccording to the original motion and allows encoding with reducedredundancy of the motion vector of the block subject to encoding.

In any one of the embodiments, the number of the neighboring blocks orthe position thereof can be set arbitrarily. For general purposerecording media such as a Blu-ray Disk (trademark), or the like, arather large number of reference pictures in the previous direction L0are encoded and a rather small number of reference pictures in thesubsequent direction L1 are encoded. In such a case, the number ofneighboring blocks may be changed depending on the prediction direction.For example, four blocks may be identified in case of the previousdirection L0, and two blocks may be identified in case of the subsequentdirection L1.

Further, according to any one of the methods for deriving motion vectorpredictor in the embodiments, by changing the method to identifying aneighboring block between the first motion vector predictor derivationprocess in the preceding step and the second motion vector predictorderivation process in the following step (i.e., conventional method forderiving a motion vector predictor), a method for identifying aneighboring block can be selected appropriately in accordance with thedegree of accuracy of the motion vector predictor derivation or thethroughput.

A bitstream of moving pictures output from the moving picture encodingdevice according to the embodiments described above has a specific dataformat so that the data stream can be decoded in accordance with thecoding method used in the embodiments. A moving picture decoding devicecorresponding to the moving picture encoding device can decode thebitstream in this specific format.

In case that a wired or wireless network is used in order to exchangebitstreams between the moving picture encoding device and the movingpicture decoding device, a bitstream may be transformed into a dataformat appropriate to the manner of transmission on the communicationpath so as to be transmitted. In this case, a moving picturetransmission device and a moving picture receiver device are provided.The moving picture transmission device transforms a bitstream outputfrom the moving picture encoding device into encoded data in a dataformat appropriate to the manner of transmission via the communicationpath and transmits the encoded data to the network. The moving picturereceiver device receives encoded data from the network, reconstructs abitstream, and provides the bitstream to the moving picture decodingdevice.

The moving picture transmission device includes a memory that buffers abitstream output from the moving picture encoding device, a packetprocessing unit that packetizes the bitstream, a transmission unit thattransmits the packetized bitstream via a network. The moving picturereceiver device includes a receiving unit that receives a packetizedbitstream via a network, a memory that buffers the received bitstream,and a packet processing unit that processes a packet of the encoded dataso as to generate a bitstream, and provides the bitstream to the movingpicture decoding device.

It is needless to mention that the processes relating to encoding anddecoding described above can be implemented as a transmission device, astorage, and/or a receiver device using hardware. The process can alsobe implemented by firmware stored in a read only memory (ROM), a flashmemory, or the like, or by software of computers or the like. Thefirmware program or the software program can be stored in a recordingmedium readable by a computer or the like and provided, can be providedfrom a server via a wired or wireless network, or can be provided bydata broadcasting as terrestrial broadcasting or satellite digitalbroadcasting.

Given above is an explanation based on the embodiments. The embodimentsare intended to be illustrative only and it will be obvious to thoseskilled in the art that various modifications to constituting elementsand processes could be developed and that such modifications are alsowithin the scope of the present invention.

What is claimed is:
 1. A moving picture coding device adapted to encodea bitstream using motion compensation prediction in units of blocksobtained by partitioning each picture of moving pictures, comprising: amotion information derivation unit configured to derive a firstdirection motion vector and a second direction motion vector of a blocksubject to coding on a basis of a first direction motion vector and asecond direction motion vector of a selected neighboring block selectedfrom spatial neighboring blocks of the block subject to coding; and amotion compensation prediction unit configured to generate a predictedvalue of the block subject to coding by motion compensation predictionusing the first direction motion vector and the second direction motionvector derived by the motion information derivation unit, a motioninformation storage unit configured to store the first direction motionvector and the second direction motion vector derived by the motioninformation derivation unit, wherein the motion information derivationunit is further configured to set a candidate block from the selectedneighboring block based on whether: a first reference index indicating afirst reference picture referred to by the first direction motion vectorof the block subject to coding and a second reference index indicating asecond reference picture referred to by the first direction motionvector of the selected neighboring block are identical with each other;and a third reference index indicating a third reference picturereferred to by the second direction motion vector of the block subjectto coding and a fourth reference index indicating a fourth referencepicture referred to by the second direction motion vector of theselected neighboring block are identical with each other, wherein thespatial neighboring blocks of the block subject to coding include atleast left block of the block subject to coding.
 2. A moving picturecoding method adapted to encode a bitstream using motion compensationprediction in units of blocks obtained by partitioning each picture ofmoving pictures, comprising: deriving a first direction motion vectorand a second direction motion vector of a block subject to coding on abasis of a first direction motion vector and a second direction motionvector of a selected neighboring block selected from spatial neighboringblocks of the block subject to coding; and generating a predicted valueof the block subject to coding by motion compensation prediction usingthe first direction motion vector and the second direction motion vectorderived by the deriving, storing the first direction motion vector andthe second direction motion vector derived by the deriving, wherein thederiving is further configured to set a candidate block from theselected neighboring block based on whether: a first reference indexindicating a first reference picture referred to by the first directionmotion vector of the block subject to coding and a second referenceindex indicating a second reference picture referred to by the firstdirection motion vector of the selected neighboring block are identicalwith each other; and a third reference index indicating a thirdreference picture referred to by the second direction motion vector ofthe block subject to coding and a fourth reference index indicating afourth reference picture referred to by the second direction motionvector of the selected neighboring block are identical with each other,wherein the spatial neighboring blocks of the block subject to codinginclude at least left block of the block subject to coding.
 3. Anon-transitory computer-readable recording medium having embodiedthereon a moving picture coding program executable by a computer andadapted to encode a bitstream using motion compensation prediction inunits of blocks obtained by partitioning each picture of movingpictures, the program comprising: a deriving module configured to derivea first direction motion vector and a second direction motion vector ofa block subject to coding on a basis of a first direction motion vectorand a second direction motion vector of a selected neighboring blockselected from spatial neighboring blocks of the block subject to coding;and a generating module configured to generate a predicted value of theblock subject to coding by motion compensation prediction using thefirst direction motion vector and the second direction motion vectorderived by the deriving module, a storing module configured to store thefirst direction motion vector and the second direction motion vectorderived by the deriving module, wherein the deriving module is furtherconfigured to set a candidate block from the selected neighboring blockbased on whether: a first reference index indicating a first referencepicture referred to by the first direction motion vector of the blocksubject to coding and a second reference index indicating a secondreference picture referred to by the first direction motion vector ofthe selected neighboring block are identical with each other; and athird reference index indicating a third reference picture referred toby the second direction motion vector of the block subject to coding anda fourth reference index indicating a fourth reference picture referredto by the second direction motion vector of the selected neighboringblock are identical with each other, wherein the spatial neighboringblocks of the block subject to coding include at least left block of theblock subject to coding.
 4. A moving picture decoding device adapted todecode a bitstream encoded by using motion compensation prediction inunits of blocks obtained by partitioning each picture of movingpictures, comprising: a motion information derivation unit configured toderive a first direction motion vector and a second direction motionvector of a block subject to decoding on a basis of a first directionmotion vector and a second direction motion vector of a selectedneighboring block selected from spatial neighboring blocks of the blocksubject to decoding; and a motion compensation prediction unitconfigured to generate a predicted value of the block subject todecoding by motion compensation prediction using the first directionmotion vector and the second direction motion vector derived by themotion information derivation unit, a motion information storage unitconfigured to store the first direction motion vector and the seconddirection motion vector derived by the motion information derivationunit, wherein the motion information derivation unit is furtherconfigured to set a candidate block from the selected neighboring blockbased on whether: a first reference index indicating a first referencepicture referred to by the first direction motion vector of the blocksubject to decoding and a second reference index indicating a secondreference picture referred to by the first direction motion vector ofthe selected neighboring block are identical with each other; and athird reference index indicating a third reference picture referred toby the second direction motion vector of the block subject to decodingand a fourth reference index indicating a fourth reference picturereferred to by the second direction motion vector of the selectedneighboring block are identical with each other, wherein the spatialneighboring blocks of the block subject to decoding include at leastleft block of the block subject to decoding.
 5. A moving picturedecoding method adapted to decode a bitstream encoded by using motioncompensation prediction in units of blocks obtained by partitioning eachpicture of moving pictures, comprising: deriving a first directionmotion vector and a second direction motion vector of a block subject todecoding on a basis of a first direction motion vector and a seconddirection motion vector of a selected neighboring block selected fromspatial neighboring blocks of the block subject to decoding; andgenerating a predicted value of the block subject to decoding by motioncompensation prediction using the first direction motion vector and thesecond direction motion vector derived by the deriving, storing thefirst direction motion vector and the second direction motion vectorderived by the deriving, wherein the deriving is further configured toset a candidate block from the selected neighboring block based onwhether: a first reference index indicating a first reference picturereferred to by the first direction motion vector of the block subject todecoding and a second reference index indicating a second referencepicture referred to by the first direction motion vector of the selectedneighboring block are identical with each other; and a third referenceindex indicating a third reference picture referred to by the seconddirection motion vector of the block subject to decoding and a fourthreference index indicating a fourth reference picture referred to by thesecond direction motion vector of the selected neighboring block areidentical with each other, wherein the spatial neighboring blocks of theblock subject to decoding include at least left block of the blocksubject to decoding.
 6. A non-transitory computer-readable recordingmedium having embodied thereon a moving picture decoding programexecutable by a computer and adapted to decode a bitstream encoded byusing motion compensation prediction in units of blocks obtained bypartitioning each picture of moving pictures, the program comprising: aderiving module configured to derive a first direction motion vector anda second direction motion vector of a block subject to decoding on abasis of a first direction motion vector and a second direction motionvector of a selected neighboring block selected from spatial neighboringblocks of the block subject to decoding; and a generating moduleconfigured to generate a predicted value of the block subject todecoding by motion compensation prediction using the first directionmotion vector and the second direction motion vector derived by thederiving module, a storing module configured to store the firstdirection motion vector and the second direction motion vector derivedby the deriving module, wherein the deriving module is furtherconfigured to set a candidate block from the selected neighboring blockbased on whether: a first reference index indicating a first referencepicture referred to by the first direction motion vector of the blocksubject to decoding and a second reference index indicating a secondreference picture referred to by the first direction motion vector ofthe selected neighboring block are identical with each other; and athird reference index indicating a third reference picture referred toby the second direction motion vector of the block subject to decodingand a fourth reference index indicating a fourth reference picturereferred to by the second direction motion vector of the selectedneighboring block are identical with each other, wherein the spatialneighboring blocks of the block subject to decoding include at leastleft block of the block subject to decoding.